package com.hooper.hosp.service;

import com.hooper.hosp.model.hosp.Hospital;
import com.hooper.hosp.vo.hosp.HospitalQueryVo;
import org.springframework.data.domain.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/28/10:31
 */
public interface HospService {

    /**
     * save or update hosp data from the remote call with json data
     * @param map
     * @return
     */
    boolean saveOrUpdate(Map<String, Object> map);

    /**
     * collect the same part of the code
     * @param request
     * @return
     */
    Map<String, Object> signKeyCheckAndMapSwitch(HttpServletRequest request);

    /**
     * get hosp obj by its hoscode
     * @param hoscode
     * @return
     */
    Hospital getHospitalByHoscode(String hoscode);

    /**
     * page query with conditions
     * @param currentPage current page
     * @param pagesSize   page size
     * @param hospQueryVo the conditions
     * @return
     */
    Page<Hospital> pageByConditions(Integer currentPage, Integer pagesSize, HospitalQueryVo hospQueryVo);

    /**
     * change the hosp status
     * @param id     hosp id
     * @param status 1 means online, 0 means offline
     */
    void changeStatus(String id,String status);

    /**
     * show the hosp details
     * @param id via id
     * @return
     */
    Hospital getHospDetailById(String id);

    /**
     * fill all the Hospital field
     * @param hospital imperfect hosp obj
     * @return
     */
    Hospital completeHosp(Hospital hospital);

    List<Hospital> findLikeName(String hosname);

    Map<String, Object> getHospInfo(String hoscode);
}
